#ifndef MATRIXMGR_HH
#define MATRIXMGR_HH
#include "matrix.hh"

CLICK_DECLS

class MatrixMgr : public Matrix {
protected:
    // the sum I+O 
    PartialGEMatrix _mIO;

    // the pre-encoded packet
    CodedBlock *_encoded;

    void draw(int i);

public:
    MatrixMgr(int k, int ds) :
            Matrix(k, ds),
            _mIO(k, 0),
            _encoded(0) {
        massert(ds > 0, "%d > 0", ds);
    }
    ~MatrixMgr();

    bool addI(CodedBlock *cb);

    WritablePacket *prepare(WritablePacket *p = 0);
    WritablePacket *take();

    const Matrix & I() const { return (*this); }
    const Matrix & IO() const { return _mIO; }
};

CLICK_ENDDECLS

#endif // def MATRIXMGR_HH

